home *** CD-ROM | disk | FTP | other *** search
/ Canadian Geographic Explorer / Canadian Geographic Explorer.iso / pc / riddler.dxr / 00034_Attempt Guess.ls < prev    next >
Encoding:
Text File  |  1996-10-03  |  1.8 KB  |  50 lines

  1. on keyDown
  2.   global gOrder, gWhoBuzzedIn, gScoreList, gValue, gSoundFXChannel, gPathToSound, fileDelimiter, gVoiceChannel, gCurrQString, gNumPlayers
  3.   set jKey to the keyPressed
  4.   set jRight to 0
  5.   case jKey of
  6.     "1":
  7.       if getAt(gOrder, 1) = 1 then
  8.         set jRight to 1
  9.       end if
  10.     "2":
  11.       if getAt(gOrder, 2) = 1 then
  12.         set jRight to 1
  13.       end if
  14.     "3":
  15.       if getAt(gOrder, 3) = 1 then
  16.         set jRight to 1
  17.       end if
  18.     otherwise:
  19.       exit
  20.   end case
  21.   if jRight then
  22.     sound playFile gSoundFXChannel, gPathToSound & "soundFX" & fileDelimiter & getAt(["liteclap", "medclap", "loudclap"], random(3)) & ".aif"
  23.     sound playFile gVoiceChannel, gPathToSound & "qanda" & fileDelimiter & "CH" & gCurrQString & "_1.aif"
  24.     setAt(gScoreList, gWhoBuzzedIn, getAt(gScoreList, gWhoBuzzedIn) + (gValue * 100))
  25.     repeat while soundBusy(gVoiceChannel)
  26.     end repeat
  27.     sound stop gSoundFXChannel
  28.     go("Play Round")
  29.   else
  30.     setAt(gScoreList, gWhoBuzzedIn, getAt(gScoreList, gWhoBuzzedIn) - (gValue * 100))
  31.     if gNumPlayers = 1 then
  32.       go("AHNN!")
  33.     else
  34.       sound playFile gSoundFXChannel, gPathToSound & "soundfx" & fileDelimiter & "buzzer.aif"
  35.       repeat while soundBusy(gVoiceChannel)
  36.       end repeat
  37.       if gNumPlayers = 2 then
  38.         sound playFile gVoiceChannel, gPathToSound & "qanda" & fileDelimiter & "taksht" & gWhoBuzzedIn & "1.aif"
  39.       else
  40.         sound playFile gVoiceChannel, gPathToSound & "qanda" & fileDelimiter & "crack" & gWhoBuzzedIn & ".aif"
  41.       end if
  42.       sound playFile gSoundFXChannel, gPathToSound & "soundFX" & fileDelimiter & "Ticking.aif"
  43.       go(marker(1))
  44.     end if
  45.   end if
  46.   set the text of field "player1 score" to string(getAt(gScoreList, 1))
  47.   set the text of field "player2 score" to string(getAt(gScoreList, 2))
  48.   set the text of field "player3 score" to string(getAt(gScoreList, 3))
  49. end
  50.